<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件绑定</title>
		<script src="../js/vue.js"></script>
	</head>
	<body>
		<div id="app">
			{{num}}
			<button v-on:click="num++">自增</button>
			<button @click="addNum">自增</button>
		</div>
		
	</body>
	<script type="text/javascript">
		const app = new Vue({
			el:"#app",
			data:{
				num:100
			},
			methods:{
				// js中方法称之为函数
				addNum(){
					this.num++
				}
			}
		})
	</script>
</html>
